Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EL-1909 single cat search page #380

Closed
wants to merge 7 commits into from

Conversation

willc-work
Copy link
Contributor

@willc-work willc-work commented Nov 22, 2024

What does this pull request do?

add new single category search page
add tests
add custom content
add custom styling for hlpas

you can test localy with this url:
http://localhost:8000/single-category-search?categories=med&search=

http://localhost:8000/single-category-search?categories=wb&search=
or modify it for the UAT environment.
You can swap the category code for any other one and it will work e.g wb, pl, hou, mat, com etc

Next steps:
at present you can submit a postcode which queries LAALAA with the postcode and category and returns a result set. which looks like this:
results=[{'telephone': '01625 704 090', 'location': {'address': 'Riverside Court', 'city': 'Wilmslow', 'postcode': 'SK9 1DL', 'point': {'type': 'Point', 'coordinates': [-2.226143, 53.329065]}, 'type': 'Office'}, 'organisation':.....
However when it gets to the template to display it it looks like this:
"Search results: {'count': 146, 'next': 'https://laa-legal-adviser-api-staging.apps.live-1.cloud-platform.service.justice.gov.uk/legal-advisers/?categories=med&page=2&postcode=WA157UE', 'previous': None, 'results': [{'telephone': '01625 704 090', 'location': {'address': 'Riverside Court', 'city': 'Wilmslow', 'postcode': 'SK9 1D

the extra text at the beginning is breaking the display. so somewhere between getting the LAALAA response and displaying it we are offloading some processing to EnglandOrWalesState and thats where I am stuck.

This issue above is solved, but in solving it I kicked the problem down the road. as a result of transforming the data myself it now cannot be displayed on the results.html template
see the comments added in this commit:
da1a680

Any other changes that would benefit highlighting?

Intentionally left blank.

Checklist

  • Provided JIRA ticket number in the title, e.g. "LGA-152: Sample title"

@willc-work willc-work force-pushed the el-1909-single-cat-search-page branch 5 times, most recently from 1bbeac5 to e47d613 Compare November 22, 2024 12:28
Copy link

sonarcloud bot commented Nov 22, 2024

@willc-work willc-work force-pushed the el-1909-single-cat-search-page branch 5 times, most recently from 0afd8bf to 48b8e74 Compare November 28, 2024 21:43
update behaviour for invalid codes to redirect to generic search

update single search page to have some content

add new category single search page
@willc-work willc-work force-pushed the el-1909-single-cat-search-page branch 2 times, most recently from 9737f6d to da1a680 Compare November 29, 2024 18:16
display categry name in  H1

handle custom content for some categories

add custom styling for hlpas
extract dictionaries to utils.py
@willc-work willc-work force-pushed the el-1909-single-cat-search-page branch from da1a680 to 777da7e Compare November 29, 2024 18:22
@willc-work willc-work force-pushed the el-1909-single-cat-search-page branch from 5beb3b2 to b0d34b9 Compare November 29, 2024 18:25
@willc-work willc-work closed this Dec 4, 2024
@willc-work willc-work deleted the el-1909-single-cat-search-page branch December 4, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant